import 'package:duuchin/config/app_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CommentLikeRead extends StatelessWidget {
  final int commentCount;
  final int thumbUpCount;
  final int readCount;

  const CommentLikeRead({
    Key key,
    this.commentCount,
    this.thumbUpCount,
    this.readCount,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Row(
        children: <Widget>[
          _icons('assets/images/icons/comment.png', commentCount),
          _icons('assets/images/icons/like.png', thumbUpCount),
          _icons('assets/images/icons/read.png', readCount),
        ],
      ),
    );
  }

  Widget _icons(String icon, int count) {
    return Expanded(
      child: Row(
        children: <Widget>[
          Image.asset(
            icon,
            width: 16,
            height: 16,
          ),
          SizedBox(width: 3),
          Expanded(
            flex: 1,
            child: Text(
              count.toString(),
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(color: AppColors.unactive, fontSize: 12),
            ),
          ),
        ],
      ),
    );
  }
}
